package com.system.healthproject.utils;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */
public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016101800714533";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpy3kCXRJTdQJwot3kZYTGE9HXvoNSr69NI0x0/wmOBRBlKBkwbXB2+y5Ct2aNzHlZspNP32cS6TUCfnwwyJopzZvEIsa4sAg70Liczx9tkRRrRlU42VHbV7nZ24fNhtN6drzepAP4mg9s2yUhcZ2wOf63UC0Sd3xWlPH8uq4p77y+OW85oTp8fI7Y8d2ltG+KdWeUfccepDDTTfBKgnkb1mk0CDy1l17Ve5J1yjNbw2Cg/TgQDFNz91tN5ftV3svfoWVzNYEWsaPMVZsMgHjYnqTqePFp8qWHFKRD5h7fbN8YLGw2dTOz2L2vsleuU5eRKXQXLBIO6kQOyqtnsNWXAgMBAAECggEAN73XtSHu4T0Zlvaw18lIJGrfSe9+V0fbyfwbnpEXhus8rajTVCWpdTYSws5IuaZ19C9+0wrpYLj0sSPrC2zfx3d7epFcIceQfGqSINCSZbrqNCl70tTtXY/YMKA0XhG0HZEbgg/gSd3x0G/FKcyN0wvHBlEo6tYVGKt/IdP7V0KWUBe6suLEfHjWcBKtdZXARCUm0aidl7OB6OiBe/VkyGyEMKff176XoesePwQmsFJO7kS/1ZHAiZJA0w79E8pPN5TwMwf59jL0cuf5MxTzwdsgoTNrfqpRnUKSgVkZvlFh8LzHny+oXNB/sfsiGh5cansXg5XyKSXmV1zz4gNAMQKBgQDnyg3aos7kIPMsiA5lzjIuh80qyZphLswkxMH83eNolXJdv2lPsfR07wf63uyU04bD1IJG86HBOZpWjbmx0qpndwdXwHLlRCs2iK5fXMb3bomb5trv3Eoiogk2aBjBy0FYmJbzxp6rN4q4xndXvK6hMbo402YzI3w16fjw0r9qeQKBgQC7h7abZldD0QtLe8Uew+W0cM9lfP6PVB/xiqglZKmfKx/YnEdAHnyMQGWGpN2fbkw1aovKBSKwpifsBYJA43vwWae6SfdqQyWlrXOFLxMId3UoqSObpu7pldU7xCDnMZH1P/P9QBLLHM7BvMFYw7jNkvk4ctavxqZ/Ko0I7FA8jwKBgCs7xNnDBFQI0VK9DfJvQ2zqZ5pTgDggQnOZP5WqzX/0YCCcU0hKKQ6mhxaD/hzEV56vRJ13U/R2ihMa3EgOwzoJOZVkkAmzbVv+ooenBnWgaIprxOp4bFuJXa6IPBXpk4ay73UI1w+YjIdqfVggGXJ3lASFacqgE8r6mTRSGuIBAoGANS7F0MhzUx5Dz8JoItN3n3amuqd6Ife/n2atTP2BRUybmXiolDyRIc1ZfZff6kkDf9qZjk9qiSJ2C+98Ax8AlSc39BLqAc7NLHFGY6z3/tyx8zgUix4Kf2AouuxiUG60cBMVBOtY6RVgZX08cAoBrPtThni6/dqeeU399VvfXW0CgYEAsSa8So0ukBtM+tqLVi7e29dC/xJv4VAgzHn362K4b3nlPfW54pY1QdIW9Gylkum+WIEKMZxqLxNmWrvO7S7QZ1q4F0/KwWAA5dLgEryFwSuCJjK7o9oKq3veIC5cEaZxSZvpFTkbJpsYOfvlLeVWvJhaT7q99m0eG3jQerXbNlc=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqct5Al0SU3UCcKLd5GWExhPR176DUq+vTSNMdP8JjgUQZSgZMG1wdvsuQrdmjcx5WbKTT99nEuk1An58MMiaKc2bxCLGuLAIO9C4nM8fbZEUa0ZVONlR21e52duHzYbTena83qQD+JoPbNslIXGdsDn+t1AtEnd8VpTx/LquKe+8vjlvOaE6fHyO2PHdpbRvinVnlH3HHqQw003wSoJ5G9ZpNAg8tZde1XuSdcozW8NgoP04EAxTc/dbTeX7Vd7L36FlczWBFrGjzFWbDIB42J6k6njxafKlhxSkQ+Ye32zfGCxsNnUzs9i9r7JXrlOXkSl0FywSDupEDsqrZ7DVlwIDAQAB";

    public static String ali_public_key="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkqrPncWs04X0WpvlryYKESqi6p125Ka+tKNdjMlNsCHUCFhrYKkiu7Me/afP5PzCbwk+eqYLSsOWjqZ05OwvNNXBy7TXltTtepqGjWkswVAAXubx9q8qCw1PIMVv8Lm1bFl6gFj9QYQQnIbGGFjrUhFqCZgpW+fmTXcayB2k54eUQpN317gwfXPNam7HjkXYPYcaTuVE0Bcmo9p+XYAaRNhT1ehzhkNlKCH+LtqfEBxxGUeTieLckfd4I8k6tvXzIrJNz1UtaJYLZVuFgVDDBZXX0Lcb3LJ2ARFFbJu5GEeT8qRqeU3KDJufdGQ/A+Zy7F4EIpJngc2qjsfkn2O+AQIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://qu31029435.qicp.vip/book/book/aliPayCallBack";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = " http://192.168.3.7:8080/payResoult";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";




//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
